//Armstrong number

# include <iostream.h>
# include <conio.h>

class Armstrong {
  int number;
public:
  void checkArmstrong();
};

void Armstrong::checkArmstrong() {
  int result = 0;
  int temp;
  cout << "Enter your number: ";
  cin >> number;
  temp = number;
  while(number) {
    result += (number%10)*(number%10)*(number%10);
    number /= 10;
  }
  if(temp == result) {
    cout << "The number is Armstrong!";
  }
  else {
    cout << "The number is not Armstrong!";
  }
}

void main() {
  clrscr();
  Armstrong as;
  as.checkArmstrong();
  getch();
}